#include "pupil.h"

Pupil::Pupil(QString name, int subjectCount)
{
    this->name = name;
    this->subjectCount = subjectCount;
    balls = new double[subjectCount];
    bonuses = new double[subjectCount];
    places = new int[subjectCount];
    ratingBall = 0;
    ratingPlace = 0;
}

Pupil::~Pupil()
{
    delete [] bonuses;
    delete [] balls;
    delete [] places;
}

QString& Pupil::getName()
{
    return name;
}

int Pupil::getBall(int ballIndex)
{
    return balls[ballIndex];
}

int Pupil::getSubjectPlace(int placeIndex)
{
    return places[placeIndex];
}

double Pupil::getBonus(int bonusIndex)
{
    return bonuses[bonusIndex];
}

double Pupil::getRatingBall()
{
    return ratingBall;
}

int Pupil::getRatingPlace()
{
    return ratingPlace;
}

void Pupil::setBall(int ballIndex, double ball)
{
    balls[ballIndex] = ball;
}

void Pupil::setBonus(int bonusIndex, double bonus)
{
    bonuses[bonusIndex] = bonus;
}

void Pupil::setRatingBall(double ratingB)
{
    ratingBall = ratingB;
}

void Pupil::setRatingPlace(int ratingP)
{
    ratingPlace = ratingP;
}

void Pupil::setSubjectPlace(int placeIndex, int place)
{
    places[placeIndex] = place;
}

int Pupil::getSubjectCount()
{
    return subjectCount;
}
